package views.activity;

import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JScrollPane;

public class UpdateActivityFrame extends JFrame {
	
	private JPanel contentPane;
	
	public UpdateVolunteerActivityView updateVolunteerActivityView;
	public UpdateCurriculumActivityView updateCurriculumActivityView;
	
	public UpdateActivityFrame(String programType) {
		this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		this.setBounds(100, 100, 450, 450);
		this.setVisible(true);
		this.setResizable(false);
		
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(null);
		this.setContentPane(contentPane);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(10, 10, 424, 400);
		scrollPane.setPreferredSize(new Dimension(424, 400));
		scrollPane.getVerticalScrollBar().setUnitIncrement(30);
		scrollPane.setAutoscrolls(true);
		contentPane.add(scrollPane);
		
		updateVolunteerActivityView = null;
		updateCurriculumActivityView = null;
		
		if (programType.equals("Volunteer")) {
			updateVolunteerActivityView = new UpdateVolunteerActivityView();
			updateVolunteerActivityView.setPreferredSize(new Dimension(404, 775));
			updateVolunteerActivityView.setVisible(true);
			scrollPane.setViewportView(updateVolunteerActivityView);
		}
		else if (programType.equals("Curriculum")) {
			updateCurriculumActivityView = new UpdateCurriculumActivityView();
			updateCurriculumActivityView.setPreferredSize(new Dimension(420, 375));
			updateCurriculumActivityView.setVisible(true);
			scrollPane.setViewportView(updateCurriculumActivityView);
		}
	}

}
